sgdk
|
Misc tools methods. More...
Go to the source code of this file.
Defines | |
#define | COMPRESSION_NONE 0 |
#define | COMPRESSION_APLIB 1 |
#define | COMPRESSION_RLE 3 |
#define | COMPRESSION_MAP_RLE 4 |
Functions | |
u32 | getFPS () |
Returns number of Frame Per Second. | |
fix32 | getFPS_f () |
Returns number of Frame Per Second (fix32 form). | |
void | KLog (char *text) |
KDebug log helper methods. | |
void | KLog_U1 (char *t1, u32 v1) |
void | KLog_U2 (char *t1, u32 v1, char *t2, u32 v2) |
void | KLog_U3 (char *t1, u32 v1, char *t2, u32 v2, char *t3, u32 v3) |
void | KLog_U4 (char *t1, u32 v1, char *t2, u32 v2, char *t3, u32 v3, char *t4, u32 v4) |
void | KLog_U1x (u16 minSize, char *t1, u32 v1) |
void | KLog_U2x (u16 minSize, char *t1, u32 v1, char *t2, u32 v2) |
void | KLog_U3x (u16 minSize, char *t1, u32 v1, char *t2, u32 v2, char *t3, u32 v3) |
void | KLog_U4x (u16 minSize, char *t1, u32 v1, char *t2, u32 v2, char *t3, u32 v3, char *t4, u32 v4) |
void | KLog_S1 (char *t1, s32 v1) |
void | KLog_S2 (char *t1, s32 v1, char *t2, s32 v2) |
void | KLog_S3 (char *t1, s32 v1, char *t2, s32 v2, char *t3, s32 v3) |
void | KLog_S4 (char *t1, s32 v1, char *t2, s32 v2, char *t3, s32 v3, char *t4, s32 v4) |
void | KLog_S1x (u16 minSize, char *t1, s32 v1) |
void | KLog_S2x (u16 minSize, char *t1, s32 v1, char *t2, s32 v2) |
void | KLog_S3x (u16 minSize, char *t1, s32 v1, char *t2, s32 v2, char *t3, s32 v3) |
void | KLog_S4x (u16 minSize, char *t1, s32 v1, char *t2, s32 v2, char *t3, s32 v3, char *t4, s32 v4) |
void | KLog_f1 (char *t1, fix16 v1) |
void | KLog_f2 (char *t1, fix16 v1, char *t2, fix16 v2) |
void | KLog_f3 (char *t1, fix16 v1, char *t2, fix16 v2, char *t3, fix16 v3) |
void | KLog_f4 (char *t1, fix16 v1, char *t2, fix16 v2, char *t3, fix16 v3, char *t4, fix16 v4) |
void | KLog_f1x (s16 numDec, char *t1, fix16 v1) |
void | KLog_f2x (s16 numDec, char *t1, fix16 v1, char *t2, fix16 v2) |
void | KLog_f3x (s16 numDec, char *t1, fix16 v1, char *t2, fix16 v2, char *t3, fix16 v3) |
void | KLog_f4x (s16 numDec, char *t1, fix16 v1, char *t2, fix16 v2, char *t3, fix16 v3, char *t4, fix16 v4) |
void | KLog_F1 (char *t1, fix32 v1) |
void | KLog_F2 (char *t1, fix32 v1, char *t2, fix32 v2) |
void | KLog_F3 (char *t1, fix32 v1, char *t2, fix32 v2, char *t3, fix32 v3) |
void | KLog_F4 (char *t1, fix32 v1, char *t2, fix32 v2, char *t3, fix32 v3, char *t4, fix32 v4) |
void | KLog_F1x (s16 numDec, char *t1, fix32 v1) |
void | KLog_F2x (s16 numDec, char *t1, fix32 v1, char *t2, fix32 v2) |
void | KLog_F3x (s16 numDec, char *t1, fix32 v1, char *t2, fix32 v2, char *t3, fix32 v3) |
void | KLog_F4x (s16 numDec, char *t1, fix32 v1, char *t2, fix32 v2, char *t3, fix32 v3, char *t4, fix32 v4) |
Bitmap * | allocateBitmap (const Bitmap *bitmap) |
Allocate a new Bitmap structure which can receive unpacked bitmap data of the specified Bitmap. If source is not packed the function only allocate space for simple shallow copy of the source. | |
TileSet * | allocateTileSet (const TileSet *tileset) |
Allocate TileSet structure which can receive unpacked tiles data of the specified TileSet. If source is not packed the function only allocate space for simple shallow copy of the source. | |
Map * | allocateMap (const Map *map) |
Allocate Map structure which can receive unpacked map data of the specified Map. If source is not packed the function only allocate space for simple shallow copy of the source. | |
Image * | allocateImage (const Image *image) |
Allocate Image structure which can receive unpacked image data of the specified Image. If source is not packed the function only allocate space for simple shallow copy of the source. | |
Bitmap * | unpackBitmap (const Bitmap *src, Bitmap *dest) |
Unpack the specified source Bitmap. | |
TileSet * | unpackTileSet (const TileSet *src, TileSet *dest) |
Unpack the specified TileSet structure. | |
Map * | unpackMap (const Map *src, Map *dest) |
Unpack the specified Map structure. | |
Image * | unpackImage (const Image *src, Image *dest) |
Unpack the specified Image structure. | |
void | unpack (u16 compression, u8 *src, u8 *dest) |
Unpack the specified source data buffer in the specified destination buffer. if source is not packed then nothing is done. | |
u32 | aplib_unpack (u8 *src, u8 *dest) |
Unpack (aplib packer) the specified source data buffer in the specified destination buffer. | |
u32 | lzkn_unpack (u8 *src, u8 *dest) |
Unpack (Konami packer) the specified source data buffer in the specified destination buffer. | |
void | rle4b_unpack (u8 *src, u8 *dest) |
Unpack (RLE 4bit packer based on Charles MacDonald code) the specified source data buffer in the specified destination buffer. | |
void | rlemap_unpack (u8 *src, u8 *dest) |
Unpack (RLE MAP packer) the specified source data buffer in the specified destination buffer. | |
void | rle4b_unpackVRam (u8 *src, u16 dest) |
Unpack (RLE 4bit packer based on Charles MacDonald code) the specified source data buffer directly in VRAM. |
Misc tools methods.
This unit provides some misc tools methods as getFPS(), unpack()...
#define COMPRESSION_APLIB 1 |
Use aplib (appack or sixpack) compression scheme.
#define COMPRESSION_MAP_RLE 4 |
Use RLE compression scheme adapted for Map data.
#define COMPRESSION_NONE 0 |
No compression.
#define COMPRESSION_RLE 3 |
Use RLE compression scheme.
Allocate TileSet structure which can receive unpacked tiles data of the specified TileSet.
If source is not packed the function only allocate space for simple shallow copy of the source.
u32 aplib_unpack | ( | u8 * | src, |
u8 * | dest | ||
) |
Unpack (aplib packer) the specified source data buffer in the specified destination buffer.
src | Source data buffer containing the packed data (aplib packer) to unpack. |
dest | Destination buffer where to store unpacked data, be sure to allocate enough space. |
u32 getFPS | ( | ) |
Returns number of Frame Per Second.
This function actually returns the number of time it was called in the last second.
i.e: for benchmarking you should call this method only once per frame update.
fix32 getFPS_f | ( | ) |
Returns number of Frame Per Second (fix32 form).
This function actually returns the number of time it was called in the last second.
i.e: for benchmarking you should call this method only once per frame update.
u32 lzkn_unpack | ( | u8 * | src, |
u8 * | dest | ||
) |
Unpack (Konami packer) the specified source data buffer in the specified destination buffer.
src | Source data buffer containing the packed data (Konami packer) to unpack. |
dest | Destination buffer where to store unpacked data, be sure to allocate enough space. |
void rle4b_unpack | ( | u8 * | src, |
u8 * | dest | ||
) |
Unpack (RLE 4bit packer based on Charles MacDonald code) the specified source data buffer in the specified destination buffer.
src | Source data buffer containing the packed data (RLE 4bit packer) to unpack. |
dest | Destination buffer where to store unpacked data, be sure to allocate enough space. |
void rle4b_unpackVRam | ( | u8 * | src, |
u16 | dest | ||
) |
Unpack (RLE 4bit packer based on Charles MacDonald code) the specified source data buffer directly in VRAM.
src | Source data buffer containing the packed data (RLE 4bit packer) to unpack. |
dest | VRAM destination address where to store unpacked dat. |
void rlemap_unpack | ( | u8 * | src, |
u8 * | dest | ||
) |
Unpack (RLE MAP packer) the specified source data buffer in the specified destination buffer.
src | Source data buffer containing the packed data (RLE MAP packer) to unpack. |
dest | Destination buffer where to store unpacked data, be sure to allocate enough space. |
void unpack | ( | u16 | compression, |
u8 * | src, | ||
u8 * | dest | ||
) |
Unpack the specified source data buffer in the specified destination buffer.
if source is not packed then nothing is done.
compression | compression type, accepted values: COMPRESSION_NONE COMPRESSION_APLIB COMPRESSION_RLE COMPRESSION_MAP_RLE |
src | Source data buffer containing the packed data (aplib packer) to unpack. |
dest | Destination buffer where to store unpacked data, be sure to allocate enough space. |
Unpack the specified source Bitmap.
src | bitmap to unpack. |
dest | Destination bitmap where to store unpacked data, be sure to allocate enough space in image buffer. If set to NULL then a dynamic allocated Bitmap is returned. |
Unpack the specified Image structure.
src | image to unpack. |
dest | Destination Image where to store unpacked data. If set to NULL then a dynamic allocated Image is returned. |
Unpack the specified Map structure.
src | map to unpack. |
dest | Destination map where to store unpacked data, be sure to allocate enough space in tiles and tilemap buffer. If set to NULL then a dynamic allocated Map is returned. |
Unpack the specified TileSet structure.
src | tiles to unpack. |
dest | Destination TileSet structure where to store unpacked data, be sure to allocate enough space in tiles and tilemap buffer. If set to NULL then a dynamic allocated TileSet is returned. |